﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Toolkit.Web.ViewComponents.DataGrid
{
    public interface IPersistentDataGridModel
    {
        int RecordStartIndex
        {
            get;
            set;
        }

        int? RecordSetSize
        {
            get;
            set;
        }

        IPersistentDataExpressionModel SortByColumnExpression
        {
            get;
            set;
        }

        bool IsSortedInDescendingOrder
        {
            get;
            set;
        }

        int? MaximumViewPortHeight
        {
            get;
            set;
        }

        IList<IPersistentDataGridColumnModel> Columns
        {
            get;
            set;
        }
    }

    [DataContract]
    public class PersistentDataGridModel : IPersistentDataGridModel
    {
        [DataMember]
        public int RecordStartIndex
        {
            get;
            set;
        }

        [DataMember]
        public int? RecordSetSize
        {
            get;
            set;
        }

        [DataMember]
        public IPersistentDataExpressionModel SortByColumnExpression
        {
            get;
            set;
        }

        [DataMember]
        public bool IsSortedInDescendingOrder
        {
            get;
            set;
        }

        [DataMember]
        public int? MaximumViewPortHeight
        {
            get;
            set;
        }

        [DataMember]
        public IList<IPersistentDataGridColumnModel> Columns
        {
            get;
            set;
        }
    }
}
